package com.hxzy.controller.mobile.order;

import com.hxzy.common.annotates.StpMobileCheckLogin;
import com.hxzy.common.controller.BaseController;
import com.hxzy.common.resp.R;
import com.hxzy.controller.mobile.order.req.SubmitOrderReq;
import com.hxzy.service.OrdersService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

@RestController
@RequestMapping(value = "/mobile/order")
@Api(tags = "手机端-订单API")
@StpMobileCheckLogin
public class OrderController extends BaseController {


    @Autowired
    private OrdersService ordersService;


    @ApiOperation(value = "用户提交订单")
    @PostMapping(value = "/submit")
    public R<String> submit(@RequestBody @Valid SubmitOrderReq req){
        String orderNum= this.ordersService.submit(req);
        return R.okHasData(orderNum);
    }



}
